package org.example.stream.demo;

import org.example.stream.demo.entity.User;

import java.util.Comparator;
import java.util.List;

public class TakeWhileMain {
    public static void main(String[] args) {
        List<User> list = UserBuilder.bindings();

        list.stream().sorted(Comparator.comparingInt(User::getAge).reversed())
                .takeWhile(l -> l.getAge() >= 50)
                .forEach(System.out::println);
    }
}
